import request from '../utils/request'
// import {reqwest_get , reqwest_url} from '../utils/Reqwest.js'


let formData = new FormData();
var searchParams = new URLSearchParams()
let data ;

export async function fetch(values){
	return request(`/api/orders?page=${values.payload.current}&pre=10${values.payload.tab}`, {
	    method: 'get',
    });
}


export async function login(values){
	// console.log(values)
	// formData.append('id', 1)
	// formData.append('estimated_total' ,123)
	// searchParams.set('id', 1)
	// searchParams.set('estimated_total' ,JSON.stringify({aa:1}))
	
	// ${values.payload.body}
	return request(`/api/registrations`,{
		method: 'post',
		body: JSON.stringify(values.payload.body)
		// body: JSON.stringify({
		// 	id: 25,
		// 	estimated_total: 123,
		// 	arr: {
		// 		a: 123
		// 	}
		// })
	})
}

export async function test(values){
	reqwest_url('/api/orders/update_estimated_total','post',{
		aa:{a:1}
	},(data)=>{
		data = data
	})
	return data
}